package com.jwds.digital.bios.business.api.controller.belt;

import com.jwds.digital.bios.business.core.infrastructure.dto.belt.BeltPerformanceHourReqDTO;
import com.jwds.digital.bios.business.core.infrastructure.vo.belt.BeltPerformanceHourRespVO;
import com.jwds.digital.bios.business.service.service.belt.IBeltPerformanceDayService;
import com.jwds.digital.bios.business.core.infrastructure.dto.belt.BeltPerformanceDayReqDTO;
import com.jwds.digital.bios.business.core.infrastructure.vo.belt.BeltPerformanceDayRespVO;
import com.jwds.tdc.framework.application.lib.BaseResponse;
import com.jwds.tdc.framework.application.lib.page.PageRequest;
import com.jwds.tdc.framework.application.lib.page.PageResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import javax.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;

/**
 * 皮带效能天表 前端控制器
 *
 * @author 林柏云
 * @date 2024-10-24
 */
@Slf4j
@Api(tags = "皮带效能天表")
@RestController
@RequestMapping("/belt/performance/day")
public class BeltPerformanceDayController {

  @Resource
  private IBeltPerformanceDayService service;

  @GetMapping("/{id}")
  @ApiOperation(value = "根据id查询")
  public BaseResponse<BeltPerformanceDayRespVO> queryById(@PathVariable("id") Long id) {
    BeltPerformanceDayRespVO respVo = service.queryById(id);
    return BaseResponse.success(respVo);
  }
  @PostMapping("/analyze")
  @ApiOperation(value = "天数据")
  public BaseResponse<BeltPerformanceHourRespVO> analyze(@RequestBody BeltPerformanceHourReqDTO reqDto) {
    BeltPerformanceHourRespVO beltPerformanceHourRespVO=service.analyze(reqDto);
    return BaseResponse.success(beltPerformanceHourRespVO);
  }

}
